//
//  CQLatestTalkCellTableViewCell.m
//  HiChat
//
//  Created by DLS151034-38 on 16/1/14.
//  Copyright © 2016年 wqiong. All rights reserved.
//

#import "CQLatestTalkCellTableViewCell.h"

@implementation CQLatestTalkCellTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)dealloc {
    [_imageV release];
    [_labelTalk release];
    [_labelUser release];
    [super dealloc];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageV.frame = CGRectMake(5, 10, self.frame.size.height - 20, self.frame.size.height - 20);
    self.imageV.layer.cornerRadius = (self.frame.size.height - 20) / 2.0;
    self.labelUser.frame = CGRectMake(self.imageV.frame.origin.x + self.imageV.frame.size.width + 30, 20, 200, 40);
    self.labelTalk.frame = CGRectMake(self.imageV.frame.origin.x + self.imageV.frame.size.width + 20, 70, 200, 20);
    
}

- (void)createSubviews {
    self.imageV = [[UIImageView alloc] init];
    self.imageV.image = [UIImage imageNamed:@"touxiang1"];
    self.imageV.layer.masksToBounds = YES;
    [self.contentView addSubview:self.imageV];
    [_imageV release];
    
    self.labelUser = [[UILabel alloc] init];
    self.labelUser.font = [UIFont systemFontOfSize:25];
    [self.contentView addSubview:self.labelUser];
    [_labelUser release];
    
    self.labelTalk = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelTalk];
    [_labelTalk release];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
